<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="./init.css"/>
    <style>
        .msg-box {
            padding: 10px;
        }

        #title-box {
            color: #3798FA;
            font-size: 24px;
            font-weight: bold;
        }

        #close-btn {
            position: absolute;
            width: 30px;
            height: 30px;
            top: 5px;
            right: 5px;
            font-size: 24px;
            cursor: pointer;
            text-align: center;
            border-radius: 3px;
        }
        #close-btn:hover{
            background: rgba(0, 0, 0, 0.4);
            color: #FFFFFF;
            transition:0.3s;
        }

        .btn-box {
            position: absolute;
            bottom: 5px;
            right: 5px;
            font-size: 24px;
        }

    </style>
</head>
<body>
<div class="msg-box">
    <div id="close-btn"><span>×</span></div>
    <h1 id="title-box">标题</h1>
    <span id="content-box">123</span>
    <div class="btn-box">
        <button>按钮1</button>
        <button>确认</button>
    </div>

</div>
<script>
    const ipc = require('electron').ipcRenderer;

    let title = document.getElementById("title-box");
    let content = document.getElementById("content-box");
    let close = document.getElementById("close-btn");
    let msg = {
        title: "sad",
        content: "dsaf",
    }
    console.log(123456);
    close.addEventListener("click", () => {
        ipc.send('hideMsgWindow');
    })
    ipc.on("setMsgContent", (e, data) => {
        title.innerHTML = data.title;
        content.innerText = data.content;
    })

</script>
</body>
</html>
